let nums = [2,7,11,15],target = 9

var twoSum = function(nums,target){
    const obj = {}

    for(let i = 0;i < nums.length; i++) {
        if (obj[target - nums[i]] !== undefined) {
            return [i,obj[target - nums[i]]]
            
        }
        obj[nums[i]] = i
    }
    console.log(obj);
    
    return []
}


console.log(twoSum(nums,target));
